<?php
	if(!isset($_POST['save_settings'])){
		

		
						if($settings['frame_modal'] == "form-1col-left"){
							$layout->admin_toolbar->form_modal1 = "checked"; 
						}elseif($settings['frame_modal'] == "form-1col-right"){
							$layout->admin_toolbar->form_modal2 = "checked"; 
						}elseif($settings['frame_modal'] == "form-2cols"){
							$layout->admin_toolbar->form_modal3 = "checked";
						}elseif($settings['frame_modal'] == "form-empty"){
							$layout->admin_toolbar->form_modal4 = "checked";
						}
						
						$layout->admin_toolbar->files = $files;
						$layout->admin_toolbar->body_filesopts = $x->makefileopts($tdst, $layout->admin_toolbar->design_color['body_bgimage']);
						$layout->admin_toolbar->header_filesopts = $x->makefileopts($tdst, $layout->admin_toolbar->design_color['header_bgimage']);
						$layout->admin_toolbar->content_filesopts = $x->makefileopts($tdst, $layout->admin_toolbar->design_color['content_bgimage']);
						$layout->admin_toolbar->sidebar_filesopts = $x->makefileopts($tdst, $layout->admin_toolbar->design_color['sidebar_bgimage']);
						$layout->admin_toolbar->footer_filesopts = $x->makefileopts($tdst, $layout->admin_toolbar->design_color['footer_bgimage']);
						
						
						$layout->admin_toolbar->languages = $x->makefileopts($x->makefilelist("./Locale", ".|..|"), $current_language);
							
							$lang = $layout->admin_toolbar->settings->enable_registration;
								if($lang == "1"){
									$layout->admin_toolbar->registration = "<input type='checkbox' id='registration' name='registration' CHECKED>";
								}else{
									$layout->admin_toolbar->registration = "<input type='checkbox' id='registration' name='registration'>";
								}
							$clean = $layout->admin_toolbar->settings->cleanurl;
								if($clean == "1"){
									$layout->admin_toolbar->cleanurl = "<input type='checkbox' id='cleanurl' name='cleanurl' CHECKED>";
								}else{
									$layout->admin_toolbar->cleanurl = "<input type='checkbox' id='cleanurl' name='cleanurl'>";
								}
								
							$tinymce = $layout->admin_toolbar->settings->tinymce;
								if($tinymce == "1"){
									$layout->admin_toolbar->tinymce = "<input type='checkbox' id='tinymce'  name='tinymce' CHECKED>";
								}else{
									$layout->admin_toolbar->tinymce = "<input type='checkbox' id='tinymce' name='tinymce'>";
								}
		}else{
				include("../Library/class.phphome.php");
				$x = new APIcore;
				$x->dbquery("UPDATE ".DBPREFIX."settings SET sitename='".$_POST['sitename']."'");
				$x->dbquery("UPDATE ".DBPREFIX."settings SET sitetitle='".$_POST['sitetitle']."'");
				$x->dbquery("UPDATE ".DBPREFIX."settings SET siteurl='".$_POST['siteurl']."'");
				$x->dbquery("UPDATE ".DBPREFIX."settings SET locale='".$_POST['locale']."'");
				
				$x->dbquery("UPDATE ".DBPREFIX."settings SET charset='".$_POST['charset']."'");
				
				if($_POST['cleanurl'] == "on") $_POST['cleanurl'] = "1"; else $_POST['cleanurl'] = "0";
				$x->dbquery("UPDATE ".DBPREFIX."settings SET cleanurl='".$_POST['cleanurl']."'");
				
				if($_POST['registration'] == "on") $_POST['registration'] = "1"; else $_POST['registration'] = "0";
				$x->dbquery("UPDATE ".DBPREFIX."settings SET enable_registration='".$_POST['registration']."'");
				
				$x->redirect($x->content->content->settings['siteurl']);
		}
?>